<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>04_模板解析_事件指令</title>
  </head>
  <body>
    <div id="app">
      <button v-on:click="handleClick">按钮</button>
    </div>
    <script src="./js/observer.js"></script>
    <script src="./js/watcher.js"></script>
    <script src="./js/compile.js"></script>
    <script src="./js/mvvm.js"></script>
    <script>
      new MVVM({
        // el: "#app",
        el: document.getElementById("app"),
        data: {},
        methods: {
          handleClick(e) {
            // 普通DOM事件，指向被绑定的DOM元素
            // 在vue中 所有事件回调函数的this指向实例对象vm
            console.log(e);
          },
        },
      });
    </script>
  </body>
</html>
